package com.crm.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

import java.net.URLConnection;
import java.util.Date;

// TokenBlacklist.java
@Component
public class TokenBlacklist {

    @Autowired
    private RedisTemplate<String, String> redisTemplate;



    // 检查 Token 是否在黑名单中
    public boolean isBlacklisted(String token) {
        return Boolean.TRUE.equals(redisTemplate.hasKey("blacklist:" + token));
    }
}
